package com.zhiwei.most.ext

import android.view.View
import com.jakewharton.rxbinding4.view.clicks
import java.util.concurrent.TimeUnit

/**
 * Create by zhiweizhu on 2022/2/28
 */
fun <T : View> T.onClickRxView(block: (T) -> Unit) {
    this.clicks()
        .throttleFirst(1, TimeUnit.SECONDS)
        .subscribe {
            block.invoke(this)
        }
}